<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<%@ include file="/pages/login/common.jsp" %>
<meta http-equiv="X-UA-Compatible" content="IE=8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta content="B2B电商平台" name="description"/>
<meta content="B2B电商平台" name="keyword"/>

<title>B2B电商平台.留言回复</title>
<link rel="stylesheet" type="text/css" href="<%=path %>/include/css/style.css" />
<link rel="stylesheet" type="text/css" href="<%=path %>/include/css/btn.css" />
<link rel="stylesheet" type="text/css" href="<%=path %>/include/css/themes.css" />
<link rel="stylesheet" href="<%=path%>/include/JQuery zTree v3.4/css/demo.css">
<link rel="stylesheet" href="<%=path%>/include/JQuery zTree v3.4/css/zTreeStyle/zTreeStyle.css">
<link rel="stylesheet" type="text/css" href="<%=path %>/include/css/register_icss.css" />
<link rel="stylesheet" type="text/css" href="<%=path %>/include/sweetalert/sweetalert.css" />
<link rel="stylesheet" type="text/css" href="<%=path %>/include/css/mmt_trading.css" />

<script type="text/javascript" src="<%=path %>/include/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=path %>/include/js/icss.cust.message.js"></script>
<script type="text/javascript" src="<%=path %>/include/js/cookies.js"></script>
<script type="text/javascript" src="<%=path%>/include/JQuery zTree v3.4/js/jquery.ztree.core-3.4.js"></script>
<script type="text/javascript" src="<%=path%>/include/JQuery zTree v3.4/js/jquery.ztree.excheck-3.4.js"></script>
<script type="text/javascript" src="<%=path %>/include/js/icss.common.js"></script>
<script type="text/javascript" src="<%=path %>/include/sweetalert/sweetalert.min.js"></script>
<script type="text/javascript" src="<%=path %>/include/sweetalert/sweetalert-dev.js"></script>

<style type="text/css">
body{}
table{border-collapse: collapse;}
tr{ 
    display:block; /*将tr设置为块体元素*/ 
    margin:10px;  /*设置tr间距为2px*/ 
    width:100%;
}
td{padding:5px;height:40px; line-height:40px;}
.td1{
	width:100px;
	font-size:14px;
	text-align:right;
	vertical-align: middle;
}
.input1{
	width:300px;
	height:40px;
	line-height:40px;
	vertical-align:middle;
	float:left;
}
.promptBox{display:inline-block;height:40px;padding-left:5px;width:200px;white-space:nowrap; z-index:50; position:relative;}
.tips-errow{background-position:-296px -22px;color:#f52c2c;}
.tips-ok{background-position:-296px 14px;color:#666;}
.tipsCur{background-position:-296px -55px;color:#666;}
.approveDiv{width:100%;height:23px;margin:0 20px;;padding:15px 0 10px 0;border-bottom: 1px solid #ADADAD;color:blue;}
</style>
<script type="text/javascript">
	$(function(){
		
	})
	
</script>
</head>
<body class="theme-red" data-theme="theme-red">
	<div id="contentDiv">
		<div style="width:100%;height:30px;border-bottom:1px solid #ADADAD;margin-top:6px;">
			<div class="toptil">留言回复详情</div>
		</div>
		<form id="fm" name="fm" class="form-horizontal form-validate" method="post" action="" novalidate="novalidate">
			<input type="hidden" id="messageId" name="messageId" value="${messageId}">
			<input type="hidden" id="curPath" name="curPath" value="<%=path %>">
			<input type="hidden" id="shopId" name="shopId" value="${messageMap.SHOP_ID }">
			<div style="width:100%;margin-top:20px;margin-left:10px;">
				<table style="width:100%;">
					<tr>
						<td class="td1"  nowrap>消费者名称：</td>
						<td class="rightTd" nowrap>
							${messageMap.USER_NAME }
						</td>
					</tr>
					<tr>
						<td class="td1"  nowrap>留言时间：</td>
						<td class="rightTd" nowrap>
							${messageMap.MESSAGE_TIME }
						</td>
					</tr>
					<tr>
						<td class="td1" nowrap style="vertical-align:top;">留言内容：</td>
						<td nowrap>
							<textarea id="msgContent" readonly name="msgContent" style="width: 274px; height: 120px; resize: none;">${messageMap.MESSAGE_CONTENT }</textarea>
						</td>
					</tr>
					<tr>
						<td class="td1" nowrap>回复内容：</td>
						<td class="rightTd" nowrap>
							<textarea id="replyContent" name="replyContent" style="width: 274px; height: 120px; resize: none;">${messageMap.REPLY_CONTENT }</textarea>
						</td>
					</tr>
					<tr><td colspan="2">&nbsp;</td></tr>
					<tr>
						<td>&nbsp;</td>
						<td style="">
							<div id="btnDiv">
								<a onclick="window.history.go(-1);" class="btn btn-primary" style="text-decoration:none;">返回</a>
							</div>
						</td>
					</tr>
				</table>
			</div>
		</form>
	</div>
</body>
 <script type="text/javascript">
  	$(document).ready(function(){
		_reHeight();
	});
	function _reHeight(){
		var main = $(window.parent.document).find("#rightFrame");
		var mainheight = $("#contentDiv").height();
		main.height(mainheight);
	}
  	var zTree = null;
	/* 
	 * 下拉树的设置 
	 */  
	var treeSetting = {  
	    view: {  
	        dblClickExpand: false  
	    },  
		data: {  
			simpleData: {  
			    enable: true,
			    rootPId: 0
			}  
		},
		check: {  
			enable: true,
			autoCheckTrigger:true
		}, 
		async:{
			enable: true,//设置ztree是否开启异步加载模式
			showLine: true ,//设置是否显示连接线
			type: "post",//post方式请求数据
			url: getUrl,//数据请求url
			autoParam:["id","name"],//异步加载时需要自动提交父节点属性的参数
			otherParam:{"otherParam":"zTreeAsyncTest"},
			dataFilter: filter
		},
		callback: {
			beforeClick: beforeClick,
			onCheck: onCheck,
			onAsyncError : zTreeOnAsyncError,//加载失败
			onAsyncSuccess: zTreeOnAsyncSuccess//加载完成
		}
	}; 
	
	function getUrl(treeId, treeNode){
		var shopId = $("#shopId").val();
		var url = "<%=path %>/shopManage/getTree.do?shopId=" + shopId;
		return url;
	}
	
	function beforeClick(treeId, treeNode) {
		var zTree = $.fn.zTree.getZTreeObj("treeDemo");
		zTree.checkNode(treeNode, !treeNode.checked, null, true);
		return false;
	}
	
	/* 
	 * 点击事件 
	 */  
	function onCheck(e, treeId, treeNode) {  
		
		var cityObj = $("#citySel");
		var shopAreaObj = $("#shopArea");
	    var zTree = $.fn.zTree.getZTreeObj("treeDemo");
		var nodes = zTree.getCheckedNodes(true);
		var changeNodes = zTree.getChangeCheckedNodes();
		var v = '';
		var ids = '';
		for (var i=0, l=nodes.length; i<l; i++) {
			if(!nodes[i].isParent){
				v += nodes[i].name + ",";
				ids += nodes[i].id + ",";
			}
		}
		if (v.length > 0 ) v = v.substring(0, v.length-1);
		if (ids.length > 0 ) ids = ids.substring(0, ids.length-1);
		cityObj.attr("value", v);
		shopAreaObj.attr("value", ids);
	}  
	//过滤函数  
    function filter(treeId, parentNode, childNodes) {  
        if (!childNodes)  
            return null;  
        for ( var i = 0, l = childNodes.length; i < l; i++) {  
            //childNodes[i].name = childNodes[i].name.replace(/\.n/g, '.');  
        }  
        return childNodes;  
    }  
    //加载完成
	var firstAsyncSuccessFlag = 0;
	function zTreeOnAsyncSuccess(event, treeId, msg) {
		if (firstAsyncSuccessFlag == 0) {
        	try {
				//调用默认展开第一个结点
			//	var nodes = zTree.getNodes();
			//	zTree.expandNode(nodes[0], true);
			//	for(var i = 0; i< nodes.length; i++){
			//		zTree.expandNode(nodes[i], true);
			//	}
			//	$("#treeDemo").click();
	            
	            //异步加载完成再折叠所有子节点
	            var nodes = zTree.getNodes();
				if (nodes.length>0) {
					var index = zTree.getNodeIndex(nodes[0]);
					var rootNode = nodes[0];
					zTree.expandNode(rootNode, false, true, null, true);
				}
	            
	            firstAsyncSuccessFlag = 1;
        	} catch (err) {
	              
         	}
    	}
	}
	//加载失败提示  
    function zTreeOnAsyncError(event, treeId, treeNode, XMLHttpRequest, textStatus, errorThrown) {  
        alert("加载错误：" + XMLHttpRequest);  
    }; 
  </script>
</html>
